import { AIToken, Token } from "@/utils/cache";
import request from "./request";

// 获取验证码
export function getPhoneCode(phone: string, ticket: string, randstr: string) {
  return request({
    url: "/user/phone/code",
    isToken: false,
    data: {
      phone,
      ticket,
      randstr
    }
  });
}

// 验证码登录
export function login(
  phone: string,
  code: string,
  share_user_uuid?: string,
  mini_code?: string
) {
  return request({
    url: "/user/phone/login",
    method: "POST",
    isToken: false,
    data: {
      phone: +phone,
      code,
      share_user_uuid,
      mini_code
    }
  });
}
// 验证码登录
export function wxlogin(code: string) {
  return request({
    url: "/wechat/login_app",
    method: "POST",
    data: {
      code
    }
  });
}
// 提交调研信息
export function research(caseType: Array<string>, question: string) {
  return request({
    url: "/user/research",
    method: "POST",
    data: {
      case_type_ids: caseType,
      question
    }
  });
}
